<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./yiyou.css">
  <script src="./jquery-3.5.1.min.js"></script>
</head>
<div class="tree-wrap">
  <div class="tree-type" id="treeType">
  </div>
  <div class="tree-company">
    <div id="treeInnerCompany" class="tree-content"></div>
  </div>
  <div class="tree-department">
    <div id="treeInnerDepartment" class="tree-content"></div>
  </div>
  <div class="tree-selected"></div>
  <p class="clear"></p>
</div>
<div class="wrap" id="wrap"></div>

<script src="./data.js"></script>
<script src="./tree.js"></script>
<script>
  // const typeArr = [
  //   {
  //     id: 0,
  //     name: '内部',
  //     level: 0,
  //     parentId: -1,
  //     type: 'inner'
  //   },
  //   {
  //     id: 1,
  //     name: '外部',
  //     level: 0,
  //     parentId: -1,
  //     type: 'outter'
  //   },
  //   {
  //     id: 2,
  //     name: '好友公司',
  //     level: 1,
  //     parentId: 1,
  //     type: 'friend'
  //   },
  //   {
  //     id: 3,
  //     name: '客商',
  //     level: 1,
  //     parentId: 1,
  //     type: 'customer'
  //   },
  //   {
  //     id: 4,
  //     name: '供应商',
  //     level: 1,
  //     parentId: 1,
  //     type: 'supply'
  //   }
  // ]

  // let typeHtml = ''

  // typeArr.map(obj => {
  //   typeHtml += `<div class="tree-type-list tree-top-${obj.parentId}" data-type="${obj.type}" data-level="${obj.level}" data-pid="${obj.parentId}" data-id="${obj.id}" style="margin-left: ${14 * obj.level}px">`
  //     + `<input class="tree-type tree-checked-${obj.id}" type="checkbox" onclick="selectChild(this)"/>`
  //     // + `<input type="checkbox" onclick="checkboxSelected(this)" name="inner-${data.topId ? data.topId : 0}" id="inner-${data.id}">`
  //     + `<label>${obj.name}</label>`
  //     + `<p class="clear"></p>`
  //     + `</div>`
  // })

  // document.getElementById('treeType').innerHTML = typeHtml

  createTree(dataObj3, $('#wrap'))
</script>

<body>

</body>

</html>